<ion-view id="login" view-title="登录" hide-nav-bar="true">

  <ion-header-bar align-title="center" class="bar-calm">
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goBack()">
        <img src="img/order-commit/backIcon.png">
      </button>
    </div>
    <h1 class="title">登录</h1>
  </ion-header-bar>
  <header ng-if="error.notifing">
    <span ng-bind="error.msg"></span>
  </header>

  <ion-content >
    <div style="height: 100px;width: 100%;text-align: center;padding:20px 0 10px 0;">
    <img src="img/login/loginlogo.png" alt="" class="logo"/>
    </div>
    <div ng-form="loginForm" class="list">
      <div style="position: relative">
        <label class="item item-input phone">
          <span class="wf-icon"></span>
          <input type="text" name="username"
              ng-model="loginData.username"
                 ng-change="num()"
              focus-me="focus == 'username'"
              ng-required="true"
              placeholder="手机号">
        </label>
        <button ng-hide="loginForm.username.$error.required" ng-click="clear('username')" class="wf-icon clean"></button>
      </div>
      <div style="position: relative">
        <label class="item item-input password">
          <span class="wf-icon"></span>
          <input type="password" name="password"
              ng-model="loginData.password"
              focus-me="focus == 'password'"
              ng-required="true"
              placeholder="密码">
        </label>
        <button ng-if="!loginForm.password.$error.required" ng-click="clear('password')" class="wf-icon clean"></button>
      </div>
      <div class="center">
        <button class="button button-balanced login button-clear" ng-click="login()" ng-disabled="loginForm.$invalid || processing">
          <div ng-if="!processing">
            登录
          </div>
          <div ng-if="processing" class="spinner">
            <ion-spinner icon="circles" class="spinner-stable"></ion-spinner>
          </div>
        </button>
      </div>
      <div class="center">
        <a class="button button-clear button-stable forgot-passwd" ng-click="goForgotPwd()">
          忘记密码
        </a>
      </div>
    </div>
    <div class="bottom-blank"></div>
  </ion-content>
</ion-view>
